package com.yifi.common.utils;

import javax.servlet.http.HttpServletRequest;

import com.jfinal.core.Controller;
import com.yifi.common.constant.ConstantInit;
import com.yifi.system.domain.MisUser;

public class ToolSession {

	public static MisUser getUser(Controller controller)
	{
		try {
			MisUser misUser= (MisUser)controller.getRequest().getSession().getAttribute(ConstantInit.loginUser);
			return misUser;
		} catch (Exception e) {
			// TODO: handle exception
			return null;
		}
	}
	public static MisUser getUser(HttpServletRequest request)
	{
		MisUser misUser= (MisUser)request.getSession().getAttribute(ConstantInit.loginUser);
		return misUser;
	}
}
